package cn.lizemin.entity.demo;

import cn.hutool.json.JSONUtil;
import cn.lizemin.entity.User;
import cn.lizemin.service.UserApi;
import cn.lzm.proxy.CommonServiceProxyFactory;

/**
 * @author lzm
 * @Date 2024/7/20
 * @description
 */
public class ConsumerTestV2 {

    /**
     * 使用动态代理来rpc调用远程接口
     */
    public static void main(String[] args) {
        UserApi proxy = CommonServiceProxyFactory.getProxy(UserApi.class);
        User user = proxy.getUserById(100);
        System.out.println(JSONUtil.toJsonStr(user));
    }

}
